import request from '@/utils/request'

export function fetchList(type, pageIndex, pageSize, title) {
  return request({
    url: '/exam/question/list/?type=' + type + '&page=' + pageIndex + '&rows=' + pageSize + '&title=' + title,
    method: 'get'
  })
}

export function fetchTree() {
  return request({
    url: '/exam/type/tree/',
    method: 'get'
  })
}

export function fetchQuestionDel(param) {
  return request({
    url: '/exam/question/delete?ids=' + param,
    method: 'delete'
  })
}

export function fetchAdd(params) {
  return request({
    url: '/exam/question/insert/',
    method: 'post',
    data: params
    // params: params
  })
}

export function fetchInsertBack(params) {
  return request({
    url: '/exam/question/insertBack/',
    method: 'post',
    data: params
  })
}

export function fetchGet(param) {
  return request({
    url: '/exam/question/get/' + param,
    method: 'get'
  })
}

export function fetchOptionList(param) {
  return request({
    url: '/exam/question/idList/?ids=' + param,
    method: 'get'
  })
}
